package com.zjj.lbw.ai.vector;

import dev.langchain4j.data.embedding.Embedding;
import dev.langchain4j.model.openai.OpenAiEmbeddingModel;
import dev.langchain4j.model.output.Response;

public class VectorTest {

    public static void main(String[] args) {

        OpenAiEmbeddingModel embeddingModel = OpenAiEmbeddingModel.builder()
                .baseUrl("http://langchain4j.dev/demo/openai/v1")
                .apiKey("demo")
                .modelName("text-embedding-3-small")
                .build();

        Response<Embedding> embed = embeddingModel.embed("你好，我叫子坚君");
        System.out.println(embed.content().toString());
		System.out.println(embed.content().vector().length);
        
    }
}
